//
//  ContributionListTableViewCell.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/21.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class ContributionListTableViewCell: UITableViewCell {
    
    lazy var imgLogo : UIImageView = {
        let value = UIImageView()
        return value
    }()
    lazy var titleL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 41, g: 41, b: 41, a: 1), textFont: UIFont.boldSystemFont(ofSize: 15))
        value.text = "标题"
        return value
    }()
    lazy var redView : UIView = {
        let value = UIView()
        value.backgroundColor = .red
        value.layer.cornerRadius = 2.5
        value.layer.masksToBounds = true
        return value
    }()
    lazy var moneyL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 141, g: 141, b: 141, a: 1), textFont: UIFont.systemFont(ofSize: 13))
        value.text = "¥800.00"
        return value
    }()
    lazy var imgRight : UIImageView = {
        let value = UIImageView(image: UIImage(named: "icon_right>"))
        return value
    }()
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setCell()
    }
    func setCell(){
        self.addSubview(imgLogo)
        imgLogo.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(Adapter(25))
            make.size.equalTo(CGSize(width: Adapter(20), height: Adapter(20)))
        }
        self.addSubview(titleL)
        titleL.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.left.equalTo(imgLogo.snp.right).offset(Adapter(20))
        }
        self.addSubview(redView)
        redView.snp.makeConstraints { (make) in
            make.centerY.equalTo(titleL.snp.top)
            make.left.equalTo(titleL.snp.right).offset(Adapter(3))
            make.size.equalTo(CGSize(width: Adapter(5), height: Adapter(5)))
        }
        self.addSubview(imgRight)
        imgRight.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-(Adapter(25)))
            make.size.equalTo(CGSize(width: Adapter(15), height: Adapter(15)))
        }
        self.addSubview(moneyL)
        moneyL.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalTo(imgRight.snp.left).offset(-(Adapter(10)))
        }
        
    }
    
}
